package org.aceor.mddal.gateway.router.handler;

import org.aceor.mddal.gateway.executor.ExecuteContext;
import org.aceor.mddal.gateway.router.RealSqlContext;

import java.util.Arrays;

/**
 * Created by lxue on 16/4/14.
 */
public class NoShardingRouteHandler implements RouteHandler {
    @Override
    public ExecuteContext route(RouteHandlerParam param) {
        ExecuteContext executeContext = new ExecuteContext();
        executeContext.sqlMap.put(
                param.defaultDbIndex, Arrays.asList(
                        new RealSqlContext(
                                param.originalSql,
                                param.sqlParsedResult.shardingContext.logicTableName)));
        return executeContext;
    }
}
